package priv.yiyuan.example.design.visitor.policy;

import priv.yiyuan.example.design.visitor.PolicyVisitor;

/**
 * @author YiYuan
 * @data 2025/7/30
 * @apoNote
 */
public class HealthInsurance implements InsurancePolicy {

    private int age;

    private boolean hasPreExistingCondition;

    public HealthInsurance(int age, boolean hasPreExistingCondition) {
        this.age = age;
        this.hasPreExistingCondition = hasPreExistingCondition;
    }

    public int getAge() {
        return age;
    }

    public boolean isHasPreExistingCondition() {
        return hasPreExistingCondition;
    }

    @Override
    public void accept(PolicyVisitor visitor) {
        visitor.visit(this);
    }
}
